find repeating elements in an array in C